package com.example.fill;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.SweepGradient;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

public class V24116 extends View {
    public V24116(Context context) {
        super(context);
    }

    public V24116(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public V24116(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        SweepGradient sweepGradient = new SweepGradient(getWidth() / 2,getHeight()/2,Color.BLUE,Color.CYAN);
        Paint paint = new Paint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeWidth(50f);
        paint.setShader(sweepGradient);
        Matrix matrix = new Matrix();
        matrix.setRotate(-90,getWidth()/2,getHeight()/2);
        sweepGradient.setLocalMatrix(matrix);
        canvas.drawArc(0,0,getWidth(),getHeight(),0,360,false,paint);
    }
}
